package com.swq.java.code.chapter18.code11;

import java.io.*;

public class CharArrayTester {
    public static void main(String args[]) throws IOException {
        char[] buff = new char[]{'a', '你', '好', '1'};
        CharArrayReader reader = new CharArrayReader(buff);
        int data;
        while ((data = reader.read()) != -1)
            System.out.print((char) data + " ");
        reader.close();  //CharArrayReader的close()方法不执行任何操作
    }
}